package com.czk.bootlettuce.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;

/**
 *
 * 前提：修改 redis.windows.conf配置：
 * notify-keyspace-events "Ex"
 *
 * @author chenzhangkun
 * @ClassName RedisKeyExpireListener
 * @description: 过期监听配置
 * @date 2024年12月24日
 */
@Configuration
public class RedisKeyExpireListenerConfig {
	@Bean
	public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory){
		RedisMessageListenerContainer container = new RedisMessageListenerContainer();
		container.setConnectionFactory(connectionFactory);
		return container;
	}

}
